<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>范例</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="dom.constants.html">预定义常量</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="class.domattr.html">DOMAttr</a></div>
 <div class="up"><a href="book.dom.html">DOM</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="dom.examples" class="chapter">
 <h1>范例</h1>

 <p class="para">
  Many examples in this reference require an XML file. We will use 
  <var class="filename">book.xml</var> that contains the following:
 </p>
 <p class="para">
  <div class="example" id="example-5274">
   <p><strong>Example #1 book.xml</strong></p>
   <div class="example-contents">
<div class="xmlcode"><pre class="xmlcode">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;!DOCTYPE book PUBLIC &quot;-//OASIS//DTD DocBook XML V4.1.2//EN&quot;
 &quot;http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd&quot; [
]&gt;
&lt;book id=&quot;listing&quot;&gt;
 &lt;title&gt;My lists&lt;/title&gt;
 &lt;chapter id=&quot;books&quot;&gt;
  &lt;title&gt;My books&lt;/title&gt;
  &lt;para&gt;
   &lt;informaltable&gt;
    &lt;tgroup cols=&quot;4&quot;&gt;
     &lt;thead&gt;
      &lt;row&gt;
       &lt;entry&gt;Title&lt;/entry&gt;
       &lt;entry&gt;Author&lt;/entry&gt;
       &lt;entry&gt;Language&lt;/entry&gt;
       &lt;entry&gt;ISBN&lt;/entry&gt;
      &lt;/row&gt;
     &lt;/thead&gt;
     &lt;tbody&gt;
      &lt;row&gt;
       &lt;entry&gt;The Grapes of Wrath&lt;/entry&gt;
       &lt;entry&gt;John Steinbeck&lt;/entry&gt;
       &lt;entry&gt;en&lt;/entry&gt;
       &lt;entry&gt;0140186409&lt;/entry&gt;
      &lt;/row&gt;
      &lt;row&gt;
       &lt;entry&gt;The Pearl&lt;/entry&gt;
       &lt;entry&gt;John Steinbeck&lt;/entry&gt;
       &lt;entry&gt;en&lt;/entry&gt;
       &lt;entry&gt;014017737X&lt;/entry&gt;
      &lt;/row&gt;
      &lt;row&gt;
       &lt;entry&gt;Samarcande&lt;/entry&gt;
       &lt;entry&gt;Amine Maalouf&lt;/entry&gt;
       &lt;entry&gt;fr&lt;/entry&gt;
       &lt;entry&gt;2253051209&lt;/entry&gt;
      &lt;/row&gt;
      &lt;!-- TODO: I have a lot of remaining books to add.. --&gt;
     &lt;/tbody&gt;
    &lt;/tgroup&gt;
   &lt;/informaltable&gt;
  &lt;/para&gt;
 &lt;/chapter&gt;
&lt;/book&gt;</pre>
</div>
   </div>

  </div>
 </p>
</div>
<hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="dom.constants.html">预定义常量</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="class.domattr.html">DOMAttr</a></div>
 <div class="up"><a href="book.dom.html">DOM</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
